<div class="sidebar-second order-navBox">
    <ul id="accordion" class="accordion">
        {php}
            $param_ca = CONTROLLER_NAME . '@' . ACTION_NAME;
        {/php}
        <li {if condition="in_array($Request.param.c, ['Decoration', 'Search']) || in_array($param_ca, ['System@web'])"}class="open"{else/}{/if}>
            <a class="link">店铺设置<i class="fa fa-angle-right"></i></a>
            <ul class="submenu" {if condition="in_array($Request.param.c, ['Decoration', 'Search']) || in_array($param_ca, ['System@web'])"}style="display: show;"{else/}style="display: none;"{/if}>
                <li>
                    <a {if condition="'System' == $Think.const.CONTROLLER_NAME && 'web' == $Think.const.ACTION_NAME"}class="active"{/if} href='{:url("System/web")}'>
                        店铺信息
                    </a>
                </li>
                <li>
                    <a {if condition="in_array($Request.action, ['index'])"}class="active"{/if} href="{:url('Decoration/index')}">
                        页面装修
                    </a>
                </li>
                <li>
                    <a {if condition="in_array($Request.action, ['page_paths'])"}class="active"{/if} href="{:url('Decoration/page_paths')}">
                        页面路径
                    </a>
                </li>
                <li>
                    <a {if condition="'Search' == $Think.const.CONTROLLER_NAME && 'hot_keywords' == $Think.const.ACTION_NAME"}class="active"{/if} href='{:url("Search/hot_keywords")}'>
                        热门搜索
                    </a>
                </li>
            </ul>
        </li>

        <li {if condition="in_array($Request.param.c, ['Shop']) || in_array($param_ca, ['PayApi@pay_api_config'])"}class="open"{/if}>
            <a class="link">商城设置<i class="fa fa-angle-right"></i></a>
            <ul class="submenu" {if condition="in_array($Request.param.c, ['Shop']) || in_array($param_ca, ['PayApi@pay_api_config'])"}style="display: show;"{else/}style="display: none;"{/if}>
                <li>
                    <a {if condition="'Shop' == $Think.const.CONTROLLER_NAME && 'conf' == $Think.const.ACTION_NAME"}class="active"{/if} href='{:url("Shop/conf")}'>商城配置</a>
                </li>
                <li>
                    <a {if condition="in_array($Request.action, ['pay_api_config'])"}class="active"{/if} href='{:url("PayApi/pay_api_config")}'>
                        支付设置
                    </a>
                </li>
            </ul>
        </li>
        {if condition="$php_servicemeal >= 2"}
        <li>
            <a {if condition="'UsersScore' == $Think.const.CONTROLLER_NAME && in_array($Think.const.ACTION_NAME, ['conf', 'index', 'edit'])"}class="active"{/if} href='{:url("UsersScore/conf")}'>积分设置</a>
        </li>
        {/if}
        <li>
            <a {if condition="'Admin' == $Think.const.CONTROLLER_NAME && 'index' == $Think.const.ACTION_NAME"}class="active"{/if} href='{:url("Admin/index")}'>员工管理</a>
        </li>
    </ul>
</div>
<script>
$(function() {
	var Accordion = function(el, multiple) {
		this.el = el || {};
		this.multiple = multiple || false;

		// Variables privadas
		var links = this.el.find('.link');
		// Evento
		links.on('click', {el: this.el, multiple: this.multiple}, this.dropdown)
	};

	Accordion.prototype.dropdown = function(e) {
		var $el = e.data.el;
			$this = $(this);
			$next = $this.next();

		$next.slideToggle();
		$this.parent().toggleClass('open');

		if (!e.data.multiple) {
			$el.find('.submenu').not($next).slideUp().parent().removeClass('open');
		}
	};

	var accordion = new Accordion($('#accordion'), false);
	$('.submenu li').click(function () {
		$(this).addClass('current').siblings('li').removeClass('current');
	});
});
</script>